import request from '@/utils/request'

export default class Role {
  // 获取角色列表
  static getRoleListService = ({ page, pagesize }: any) =>
    request.get('/sys/role', { params: { page, pagesize } })

  static addRoleService = (data: any) => request.post('/sys/role', data)

  static updateRoleService = (data: any) =>
    request.put(`/sys/role/${data.id}`, data)

  static deleteRoleService = (id: any) => request.delete(`/sys/role/${id}`)

  static getRoleDetailService = (id: any) => request.get(`/sys/role/${id}`)

  // 给角色分配权限
  static assignPermService = (data: any) =>
    request.put('/sys/role/assignPerm', data)
}
